<template>
  <div>
    <input 
      type="text" 
      placeholder="请输入……" 
      v-model="inputValue"
      @keydown.enter="addNew"
    />
  </div>
</template>

<script>
export default {
  name:'TodoInput',
  data(){
    return {
      inputValue:''
    }
  },
  methods:{
    addNew(){
      this.$emit('addNewTodoItem',this.inputValue)
      this.inputValue=''
    }
  }
}
</script>

<style lang="">
  
</style>